package com.xyy.saas.payment.cores.enums;

public enum ApplyBankcardStatusEnum {
    CREATE(1, "创建中"),
    AUDITING(2, "审核中"),
    PASS(4, "待验证"),
    REJECT(8, "审核驳回"),
    FAIL(16, "失败"),
    COMPLETE(32, "完成"),
    ;

    /**
     * 是否可以提交申请
     */
    public static boolean canCreate(Integer status) {
        return REJECT.status.equals(status) || FAIL.status.equals(status) || COMPLETE.status.equals(status);
    }

    /**
     * 是否可以提交申请
     */
    public static boolean canApply(Integer status) {
        return PASS.status.equals(status) || REJECT.status.equals(status) || FAIL.status.equals(status) || COMPLETE.status.equals(status);
    }

    /**
     * 状态
     */
    public static String getStatusDesc(Integer status) {
        for(ApplyBankcardStatusEnum item : values()) {
            if(item.getStatus().equals(status)) {
                return item.getDesc();
            }
        }

        return "";
    }

    ApplyBankcardStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    private Integer status;
    private String desc;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
